#pragma once
#include "ASN1Set.h"
#include "ASN1Sequence.h"
#include "ASN1ObjectIdentifier.h"
#include "ASN1PrintableString.h"

namespace AppliedCryptography
{
	/*
		Name ::= SEQUENCE OF RelativeDistinguishedName

		RelativeDistinguishedName ::= SET OF AttributeValueAssertion

		AttributeValueAssertion ::= SEQUENCE {
			attributeType           OBJECT IDENTIFIER,
			attributeValue          ANY
			}
	*/
	class Name : public ASN1Sequence
	{
	protected:
		Name(ClassBits classBits, ConstructedBit constucted, TypeNumberBits number);

	public:
		Name();
		Name(const Name& other);
		virtual ~Name();

	protected:
		// These are protected to prevent calling them from outside
		virtual ASN1Sequence& add(ASN1Encodable& obj);
		virtual ASN1Encodable& get(unsigned int index) const;

	public:
		virtual Name& add(ASN1ObjectIdentifier& oid, ASN1PrintableString& value);
		virtual Name& operator=(const Name& other);
		virtual std::vector<byte> getContentBits() const;

	public:
		static ASN1ObjectIdentifier CN;
		static ASN1ObjectIdentifier O;
		static ASN1ObjectIdentifier C;
	};


}; // namespace AppliedCryptography
